package com.youjiang.meeting.utils.weixin;

import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.Date;
import java.util.Map;
import java.util.Properties;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import org.apache.commons.lang.StringUtils;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.ParseException;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;
import org.springframework.beans.factory.annotation.Autowired;

import com.youjiang.meeting.mapper.WxconfigMapper;
import com.youjiang.meeting.po.UserInfo;
import com.youjiang.meeting.po.Wxconfig;
import com.youjiang.meeting.service.UserService;
import com.youjiang.meeting.service.impl.UserServiceImpl;
import com.youjiang.meeting.service.impl.WeiXinMassegeServiceImpl;
import com.youjiang.meeting.utils.ToolUtils;
import com.youjiang.meeting.utils.weixinbean.AccessToken;
import com.youjiang.meeting.utils.weixinbean.Jsapi_ticket;
import com.youjiang.meeting.utils.weixinbean.TemplateidModel;

import net.sf.json.JSONObject;

public class WeixinUtil {
	
	@Autowired
	private WxconfigMapper wMapper;
	
	private static UserService service;
	/***微信token**/
	public static  String Token;
	/**微信appid**/
	public static  String APPID;
	/**微信随机字符串**/
	public static  String APPSECRET;
	/**微信商户号**/
	public static String MCHID;
	/**微信密钥**/
	public static String KEY;
	/**平台登陆入口**/
	public static  String APPURL;
	/**微信支付回调接口**/
	public static String NOTIFYURL;
	/**微信文件保存地址**/
	public static String SYSTEMPATH;
	public static String DOMAINNAME;
	public static final String ACCESS_TOKEN_URL = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=APPID&secret=APPSECRET";
	public static final String UPLOAD_URL = "https://api.weixin.qq.com/cgi-bin/media/upload?access_token=ACCESS_TOKEN&type=TYPE";
	public static final String UPLOADIMG_URL = "https://api.weixin.qq.com/cgi-bin/media/uploadimg?access_token=ACCESS_TOKEN";
	public static final String TICKET_URL = "https://api.weixin.qq.com/cgi-bin/ticket/getticket?access_token=ACCESS_TOKEN&type=jsapi";
	public static final String MATERIALDOWNLOADURL="https://api.weixin.qq.com/cgi-bin/media/get?access_token=ACCESS_TOKEN&media_id=MEDIA_ID";
	private static String SENDMODELURL="https://api.weixin.qq.com/cgi-bin/message/template/send?access_token=ACCESS_TOKEN";
	public static String TOKENURL="https://api.weixin.qq.com/sns/oauth2/access_token?appid=APPID&secret=SECRET&code=CODE&grant_type=authorization_code";
	public static String USERINFOURL="https://api.weixin.qq.com/sns/userinfo?access_token=ACCESS_TOKEN&openid=OPENID&lang=zh_CN";
	//private static final String IMAGETYPE="image";
	/**获取坐标的url*/
	public static final String GET_COORDINATE_URL = "http://apis.map.qq.com/ws/geocoder/v1/";
	/**获取坐标的key*/
	public static  String GET_COORDINATE_KEY;
	
	
	static {
		InputStream ins=WeixinUtil.class.getResourceAsStream("/weixin.properties");  
	    Properties p = new Properties();
	    String path = WeixinUtil.class.getResource("/").getPath();
	   
	    String os = System.getProperty("os.name");
	    if(os.toLowerCase().startsWith("win")){
	    	SYSTEMPATH=path.substring(1, path.indexOf("/WEB-INF"))+"/systemWeixin";
	    }else{
	    	SYSTEMPATH=path.substring(0,  path.indexOf("/WEB-INF"))+"/systemWeixin";
	    }
	    
	    
	    System.out.println("-------"+SYSTEMPATH);
	    try {
			p.load(ins);
			APPID=p.getProperty("appid");
			APPSECRET=p.getProperty("appsecret");
			MCHID=p.getProperty("mchid");
			KEY=p.getProperty("key");
			Token=p.getProperty("token");
			DOMAINNAME=p.getProperty("url");
			NOTIFYURL = p.getProperty("url");
		} catch (IOException e) {
			e.printStackTrace();
		}
		
	}
	
	/**
	 * 模板id<br>
	 * {{first.DATA}}<br>
	 	学生姓名：{{keyword1.DATA}}<br>
		留言内容：{{keyword2.DATA}}<br>
		回复内容：{{keyword3.DATA}}<br>
		回复教师：{{keyword4.DATA}}<br>
		{{remark.DATA}}
	 */
	public static String TEMPLATEMODEL1="9abK0-eQSYEsue6_JDxS6fw3pZDiWjwWDsAvPVpgnrQ";
	//public static String TEMPLATEMODEL1="6GSfiWU-bzTcwoDznIFJjPc_n-p31o4riot5qNgAeMo";
	
	/**
	 * get请求
	 * 
	 * @param url
	 * @return
	 * @throws ParseException
	 * @throws IOException
	 */
	public static JSONObject doGetStr(String url) throws ParseException, IOException {
		//DefaultHttpClient client = new DefaultHttpClient();
		CloseableHttpClient client = HttpClients.createDefault();
		HttpGet httpGet = new HttpGet(url);
		JSONObject jsonObject = null;
		HttpResponse httpResponse = client.execute(httpGet);
		HttpEntity entity = httpResponse.getEntity();
		if (entity != null) {
			String result = EntityUtils.toString(entity, "UTF-8");
			jsonObject = JSONObject.fromObject(result);
		}
		
		//client.getConnectionManager().shutdown();
		client.close();
		//client = null;
		return jsonObject;
	}

	/**
	 * POST请求
	 * 
	 * @param url
	 * @param outStr
	 * @return
	 * @throws ParseException
	 * @throws IOException
	 */
	public static JSONObject doPostStr(String url, String outStr) throws ParseException, IOException {
		CloseableHttpClient client = HttpClients.createDefault();
		HttpPost httpost = new HttpPost(url);
		JSONObject jsonObject = null;
		httpost.setEntity(new StringEntity(outStr, "UTF-8"));
		HttpResponse response = client.execute(httpost);
		String result = EntityUtils.toString(response.getEntity(), "UTF-8");
		jsonObject = JSONObject.fromObject(result);
		
		client.close();
		return jsonObject;
	}


	/**
	 * 网止获取Jsapi_ticket
	 * 
	 * @return
	 * @throws ParseException
	 * @throws IOException
	 * @throws ClassNotFoundException
	 */
	private static Jsapi_ticket getJsapi(String appid,String appsecrect) throws ParseException, IOException, ClassNotFoundException {
		Jsapi_ticket ticket = new Jsapi_ticket();
		AccessToken at = WeixinUtil.getAddreAccessToken(appid,appsecrect);
		String url = TICKET_URL.replace("ACCESS_TOKEN", at.getToken());
		JSONObject jsonObject = doGetStr(url);
		if (jsonObject != null) {
			ticket.setErrcode(jsonObject.optInt("errcode",0));
			ticket.setErrmsg(jsonObject.optString("errmsg","null"));
			ticket.setExpires_in(jsonObject.optLong("expires_in"));
			ticket.setTicket(jsonObject.optString("ticket"));
			ticket.setNewtime(new Date().getTime());
		}
		return ticket;
	}

	/**
	 * 保存从网上获取的AccessToken
	 * @param appsecrect 
	 * @param appid 
	 * 
	 * @return
	 */
	private static AccessToken findAccessToken(String appid, String appsecrect) {
		AccessToken at = null;
		try {
			String realpath=SYSTEMPATH;
			File filePath=new File(realpath);
			if(!filePath.exists()){
				filePath.mkdir();
			}
			File file=new File(realpath,"accessToken.myobj");
			if(!file.exists()){
				file.createNewFile();
			}
			at = WeixinUtil.getAccessToken(appid,appsecrect);
			ObjectOutputStream out = new ObjectOutputStream(new FileOutputStream(file));
			out.writeObject(at);
			out.flush();
			out.close();
			
		} catch (Exception e) {
			e.printStackTrace();
		}
		return at;

	}
	
	/**
	 * 网上获取accessToken
	 * @param appsecrect 
	 * @param appid 
	 * 
	 * @return
	 * @throws ParseException
	 * @throws IOException
	 */
	private static AccessToken getAccessToken(String appid, String appsecrect) throws ParseException, IOException {
		AccessToken token = new AccessToken();
		String url = ACCESS_TOKEN_URL.replace("APPID", appid).replace("APPSECRET", appsecrect);
		JSONObject jsonObject = doGetStr(url);
		if (jsonObject != null) {
			String errcode=jsonObject.optString("errcode",null);
			if(errcode!=null){
				token.setCode(jsonObject.optString("errcode","null")+" "+jsonObject.optString("errmsg"));
				System.out.println(token.toString());
			}else{
				token.setToken(jsonObject.optString("access_token","null"));
				token.setExpiresIn(jsonObject.optInt("expires_in",0));
				token.setNewtime(new Date().getTime());
			}
		}
		return token;
	}


	/**
	 * 从本地上得到AccessToken 如果过期会从网上获取
	 * @param appsecrect 
	 * @param appid 
	 * 
	 * @return
	 * @throws FileNotFoundException
	 * @throws IOException
	 * @throws ClassNotFoundException
	 */
	public static AccessToken getAddreAccessToken(String appid, String appsecrect) throws FileNotFoundException, IOException, ClassNotFoundException {
		AccessToken at = null;
		String realpath=SYSTEMPATH;
		File filePath=new File(realpath);
		if(!filePath.exists()){
			filePath.mkdir();
		}
		File file=new File(realpath,"accessToken.myobj");
		if (!file.exists()) {
			at = findAccessToken(appid,appsecrect);
		} else {
			ObjectInputStream in = new ObjectInputStream(new FileInputStream(file));
			at = (AccessToken) in.readObject();
			long time = new Date().getTime();
			if (((time - at.getNewtime()) / 1000)+600 > at.getExpiresIn()) {
				at = findAccessToken(appid,appsecrect);
			}
			in.close();
		}
		return at;
	}

	/**
	 * 保存从网上获取的 Jsapi_ticket
	 * 
	 * @return
	 * @throws ParseException
	 * @throws IOException
	 * @throws ClassNotFoundException
	 */
	private static Jsapi_ticket findJsapi_ticket(String appid,String appsecrect) throws ParseException, IOException, ClassNotFoundException {
		System.out.println("从网上得到jsapi");
		Jsapi_ticket ticket = null;
		String realpath=SYSTEMPATH;
		File filePath=new File(realpath);
		if(!filePath.exists()){
			filePath.mkdir();
		}
		File file=new File(realpath, "jsapi_ticket.myobj");
		if(!file.exists()){
			file.createNewFile();
		}
		ticket = WeixinUtil.getJsapi(appid,appsecrect);
		ObjectOutputStream out = new ObjectOutputStream(new FileOutputStream(file));
		if (ticket != null) {
			out.writeObject(ticket);
			out.flush();
			out.close();
		} else {
			System.out.println("null");
		}

		return ticket;
	}

	/**
	 * 获取本地的Jsapi_ticket 如果过期会从网上获取
	 * 
	 */
	public static Jsapi_ticket getJsapi_ticket(String appid,String appsecrect) throws Exception {
		Jsapi_ticket ticket = null;
		String realpath=SYSTEMPATH;
		File filePath=new File(realpath);
		if(!filePath.exists()){
			filePath.mkdir();
		}
		File file = new File(realpath,"jsapi_ticket.myobj");
		if (!file.exists()) {
			ticket = findJsapi_ticket(appid,appsecrect);
		} else {
			ObjectInputStream in = new ObjectInputStream(new FileInputStream(file));
			ticket = (Jsapi_ticket) in.readObject();
			long time = new Date().getTime();
			if (((time - ticket.getNewtime()) / 1000)+600 >ticket.getExpires_in()) {
				ticket = findJsapi_ticket(appid,appsecrect);
			}
			in.close();
		}

		return ticket;
	}
	/**
	 * 微信头像下载
	 * @param imgurl 图片地址
	 * @param openid 保存图片名称
	 * @param uploadpath 保存图片的web地址
	 * @return 保存图片的名
	 * @throws Exception
	 */
	public static String downloadHeadImg(String imgurl, String openid,String uploadpath) throws Exception {
		if(StringUtils.isEmpty(uploadpath)){
			return null;
		}
		
		String realpath=uploadpath;
		String requestUrl = "http://wx.qlogo.cn/mmopen/lZpjOu9ibSPCrXJYXf3ibjuWH3FHxsmoHgUfdtGcdgaOGoamicvgEAjicowd7eVqLwB3U5EXAUTiaHeNWRmpFEEA4SE1jpg3cJ7cs/0";
		if(imgurl!=null){
			requestUrl = imgurl;
		}else{
			return null;
		}
		File path= new File(realpath);
		//如何文件夹不存在就创建文件夹
		if(!path.exists()){
			path.mkdirs();
		}
		URL url = new URL(requestUrl);
		HttpURLConnection conn = (HttpURLConnection) url.openConnection();
		conn.setDoInput(true);
		conn.setRequestMethod("GET");
		String contentType = conn.getHeaderField("Content-Type");
		String imgType = contentType.substring(contentType.indexOf("/") + 1, contentType.length());
		String filePath = openid + "." + imgType;
		BufferedInputStream bis = new BufferedInputStream(conn.getInputStream());
		FileOutputStream fos = new FileOutputStream(new File(path,filePath));
		byte[] buf = new byte[1024];
		int len = 0;
		while ((len = bis.read(buf)) != -1) {
			fos.write(buf, 0, len);
		}
		fos.close();
		bis.close();
		conn.disconnect();
		return filePath;
	}
	/**
	 * 微信图片下载
	 * @param accessToken
	 * @param mediaId 保存图片的web地址 
	 * @param savePath 
	 * @param appsecrect 
	 * @param appid 
	 * @return 保存图片的名字
	 * @throws IOException 
	 * @throws ClassNotFoundException 
	 * @throws FileNotFoundException 
	 */
	public static String downloadMedia(String mediaId,String savePath, String appid, String appsecrect) throws FileNotFoundException, ClassNotFoundException, IOException{
		if(StringUtils.isEmpty(savePath)){
			return null;
		}
		AccessToken at=getAddreAccessToken(appid,appsecrect);
		String realpath=savePath;
		File path= new File(realpath);
		//如何文件夹不存在就创建文件夹
		if(!path.exists()){
			path.mkdirs();
		}
		String filePath=null;
		
		String requestUrl=MATERIALDOWNLOADURL.replace("ACCESS_TOKEN", at.getToken()).replace("MEDIA_ID", mediaId);
		try {
			URL url=new URL(requestUrl);
			HttpURLConnection conn=(HttpURLConnection) url.openConnection();
			conn.setDoInput(true);
			conn.setRequestMethod("GET");
			//String fileExt=conn.getHeaderField("filename");
			String contentType=conn.getHeaderField("Content-Type");
			//String Contentdisposition=conn.getHeaderField("Content-disposition");
			//String date=conn.getHeaderField("Date");
			//String ContentLength=conn.getHeaderField("Content-Length");
			String imgType = contentType.substring(contentType.indexOf("/") + 1, contentType.length());
			if(imgType.indexOf("json")!=-1){
				 at = findAccessToken(appid,appsecrect);
				 requestUrl=MATERIALDOWNLOADURL.replace("ACCESS_TOKEN", at.getToken()).replace("MEDIA_ID", mediaId);
				 url=new URL(requestUrl);
				 conn=(HttpURLConnection) url.openConnection();
				 contentType=conn.getHeaderField("Content-Type");
				 imgType = contentType.substring(contentType.indexOf("/") + 1, contentType.length());
				 if(imgType.indexOf("json")!=-1){
					 return null;
				 }else{
					 	filePath = mediaId + "." + imgType;
						BufferedInputStream bis=new BufferedInputStream(conn.getInputStream());
						FileOutputStream fos=new FileOutputStream(new File(path,filePath));
						byte[] buf=new byte[1024];
						int len=0;
						while ((len=bis.read(buf))!=-1) {
							fos.write(buf, 0, len);
						}
						fos.close();
						bis.close();
				 }
			}else{
				filePath = mediaId + "." + imgType;
				BufferedInputStream bis=new BufferedInputStream(conn.getInputStream());
				FileOutputStream fos=new FileOutputStream(new File(path,filePath));
				byte[] buf=new byte[1024];
				int len=0;
				while ((len=bis.read(buf))!=-1) {
					fos.write(buf, 0, len);
				}
				fos.close();
				bis.close();
			}
			conn.disconnect();
		} catch (MalformedURLException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}
		return filePath;
	}
	
	
	/**
	 * 通过地址名获取坐标
	 * @param address 纬度,经度 
	 * @return
	 */
	public static String getCoordinate(String address) throws Exception{
		JSONObject jsonObject = null;
		jsonObject = doGetStr(GET_COORDINATE_URL + "?address=" + address + "&key=" + GET_COORDINATE_KEY);
		System.out.println("json: " + jsonObject.toString());
		String coordinate = "";
		int status = (Integer) jsonObject.opt("status");
		if (status == 0) {
			//请求成功
			JSONObject resultJson = (JSONObject) jsonObject.opt("result");
			JSONObject locationJson = (JSONObject) resultJson.opt("location");
		    if (locationJson != null) {
		    	double lat = (Double) locationJson.opt("lat");
		    	double lng = (Double) locationJson.opt("lng");
		    	coordinate = lat + "," + lng;
			}
		}
		
		return coordinate;
	}
	/**
	 * 模板发送
	 * @param openid
	 * @param templateid 模板id
	 * @param context  模板数据
	 * @param showURL 用户点击的跳转
	 * @param color 颜色 可以为null
	 * @return
	 * @throws Exception
	 */
//	public static JSONObject sendModel(String openid,String templateid,Map<String,TemplateidModel> context,String showURL,String color) throws Exception{
//		if(!StringUtils.isEmpty(openid)&&!StringUtils.isEmpty(templateid)&&context.size()!=0){
//				JSONObject json=new JSONObject();
//				String sendurl=SENDMODELURL.replace("ACCESS_TOKEN", getAddreAccessToken().getToken());
//		json.put("data", context);
//		json.put("touser", openid);
//		json.put("template_id", templateid);
//		if(StringUtils.isEmpty(color)){
//			json.put("topcolor", "#FF0000");
//		}else{
//			json.put("topcolor", color);
//		}
//		if(!StringUtils.isEmpty(showURL))
//		json.put("url", showURL);
//		JSONObject doPostStr = doPostStr(sendurl, json.toString());
//		return doPostStr;
//		}
//		return null;
//	}
	/***scope参数中的是snsapi_base<br>
	 * 微信得到openid<br>
     *  正常返回   openid	用户唯一标识，请注意，在未关注公众号时，用户访问公众号的网页，也会产生一个用户和公众号唯一的OpenID<br>
	 * 	出错 返回 "errmsg":"invalid code"<br>
	 * **/
//	public String weixinCodeToOpenid(String code) throws ParseException, IOException{
//		String url=TOKENURL.replace("CODE", code).replace("APPID", WeiXinMassegeServiceImpl.config.getAppid()+"").replace("SECRET",WeiXinMassegeServiceImpl.config.getApsecrect());
//		JSONObject postStr = WeixinUtil.doGetStr(url);
//		String openid=postStr.optString("openid",null);
//		if(StringUtils.isEmpty(openid)){
//			openid=postStr.optString("errmsg",null);
//		}
//		return openid;
//	}
	/***
	 * scope参数是snsapi_userinfo
	 * 正常返回{ openid	用户的唯一标识<br>
	   nickname	用户昵称<br>
       sex	用户的性别，值为1时是男性，值为2时是女性，值为0时是未知<br>
       province	用户个人资料填写的省份<br>
       city	普通用户个人资料填写的城市<br>
       country	国家，如中国为CN<br>
       headimgurl	用户头像，最后一个数值代表正方形头像大小（有0、46、64、96、132数值可选，0代表640*640正方形头像），用户没有头像时该项为空。若用户更换头像，原有头像URL将失效。<br>
       privilege	用户特权信息，json 数组，如微信沃卡用户为（chinaunicom）<br>
       unionid	只有在用户将公众号绑定到微信开放平台帐号后，才会出现该字段。详见：获取用户个人信息（UnionID机制）<br>
	 * }
	 * 错误返回{
	 * {"errcode":40003,"errmsg":" invalid openid "}
	 * }
	 * @param code
	 * @param isInfo scope参数是snsapi_userinfo
	 * @return
	 * @throws ParseException
	 * @throws IOException
	 */
//	public static JSONObject weixinCodeToInfo(String code,boolean isInfo,HttpServletRequest req) throws ParseException, IOException{
//		HttpSession session = req.getSession();
//		UserInfo info = (UserInfo) session.getAttribute("userInfo");
//		JSONObject obj = new JSONObject();
//		if(info==null){
//			obj.put("code", 00);
//			obj.put("msg", "用户登录超时");
//			return obj;
//		}
//		int userid = info.getId();
//	
//		//用code得到openid
//		String url=TOKENURL.replace("CODE", code).replace("APPID", WeiXinMassegeServiceImpl.config.getAppid()+"").replace("SECRET",WeiXinMassegeServiceImpl.config.getApsecrect());
//		JSONObject postStr = WeixinUtil.doGetStr(url);
//		//得到openid和网页access_token
//		if(!isInfo){
//			return postStr;
//		}
//		String token=postStr.optString("access_token",null);
//		String openid=postStr.optString("openid");
//		String errcode=postStr.optString("errcode",null);
//		if(errcode!=null){
//			return postStr;
//		}
//		String infoUrl=USERINFOURL.replace("ACCESS_TOKEN", token).replace("OPENID", openid);
//		JSONObject userinfo = WeixinUtil.doGetStr(infoUrl);
//		return userinfo;
//	}
	private static String USERINFOFROMOPENIDURL="https://api.weixin.qq.com/cgi-bin/user/info?access_token=ACCESS_TOKEN&openid=OPENID&lang=zh_CN";
	/***
	 * 得到微信用户信息
	 * @param openid
	 * @param appsecrect 
	 * @param appid 
	 * @return
	 * @throws FileNotFoundException
	 * @throws ClassNotFoundException
	 * @throws IOException
	 */
	public static JSONObject  toUserFromOpenid(String openid, String appid, String appsecrect) throws FileNotFoundException, ClassNotFoundException, IOException{
		if(StringUtils.isEmpty(openid)){
			return null;
		}
		String url=USERINFOFROMOPENIDURL.replace("ACCESS_TOKEN", getAddreAccessToken(appid,appsecrect).getToken()).replace("OPENID", openid);
		JSONObject doGetStr = doGetStr(url);
		if(!StringUtils.isEmpty(doGetStr.optString("errcode", null))){
			AccessToken token2 = findAccessToken(appid,appsecrect);
			url=USERINFOFROMOPENIDURL.replace("ACCESS_TOKEN", token2.getToken()).replace("OPENID", openid);
			doGetStr = doGetStr(url);
			if(!StringUtils.isEmpty(doGetStr.optString("errcode", null))){
				return null;
			}else{
				return doGetStr;
			}
		}
		return doGetStr;
	}


	public static JSONObject weixinCodeToInfo(String code, boolean b, HttpServletRequest req, String appid,
			String apsecrect) throws ParseException, IOException {
		// TODO Auto-generated method stub
		//用code得到openid
		String url=TOKENURL.replace("CODE", code).replace("APPID", appid).replace("SECRET",apsecrect);
		JSONObject postStr = WeixinUtil.doGetStr(url);
		//得到openid和网页access_token
		if(!b){
			return postStr;
		}
		String token=postStr.optString("access_token",null);
		String openid=postStr.optString("openid");
		String errcode=postStr.optString("errcode",null);
		if(errcode!=null){
			return postStr;
		}
		String infoUrl=USERINFOURL.replace("ACCESS_TOKEN", token).replace("OPENID", openid);
		JSONObject userinfo = WeixinUtil.doGetStr(infoUrl);
		return userinfo;
	}

	
}
